package log;

import storage.file.*;
import static storage.file.Block.*;


public class BasicLogRecord {

	private Block bk;
	private int pos;

	public BasicLogRecord(Block bk, int pos) {
		this.bk = bk;
		this.pos = pos;
	}
	
	public int nextInt() {
		int result = bk.getInt(pos);
		pos += INT_SIZE;
		return result;
	}
	
	public byte nextByte() {
		byte result = bk.getByte(pos);
		pos += INT_SIZE;
		return result;
	}
	
	public String nextString() {
		String result = bk.getString(pos);
		pos += STRING_SIZE(result.length());
		return result;
	}
	
	public boolean nextBoolean() {
		boolean result = bk.getBoolean(pos);
		pos += BOOLEAN_SIZE;
		return result;
	}
	
	public double nextDouble() {
		double result = bk.getDouble(pos);
		pos += DOUBLE_SIZE;
		return result;
	}
	
	public long nextLong() {
		long result = bk.getLong(pos);
		pos += LONG_SIZE;
		return result;
	}
	
	public float nextFloat() {
		float result = bk.getFloat(pos);
		pos += FLOAT_SIZE;
		return result;
	}
}
